//
//  Music.m
//  LastOne
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 sc. All rights reserved.
//

#import "Music.h"

@implementation Music
+ (Music *)shareInstance
{
    static Music *music = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        music = [[Music alloc] init];
    });
    return music;
}

- (void)playMusicWith:(NSString *)urlString
{
    _currentURL = urlString;
    [_player pause];
    _player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlString]];
    [_player play];
}

- (void)playfileURLWithPath:(NSString *)String
{
    _currentURL = String;
    [_player pause];
    _player = [[AVPlayer alloc] initWithURL:[NSURL fileURLWithPath:String]];
    [_player play];
}
@end
